Skip to content

Add support for include_institution_data flag#134

Merged
notthefakestephen merged 7 commits intomasterfrom
st-add-include-institution-data
Mar 7, 2019
Merged

Add support for include_institution_data flag#134
notthefakestephen merged 7 commits intomasterfrom
st-add-include-institution-data

Conversation

@notthefakestephen
Copy link
Copy Markdown
Contributor

Supported for
/institutions/search
/institutions/get_by_id
/institutions/get

Supported for
/institutions/search
/institutions/get_by_id
/institutions/get
this.institutionId = institutionId;
}

public InstitutionsGetByIdRequest(String institutionId, boolean includeInstitutionData) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a .withIncludeInstitutionData(boolean) instead of creating more constructors?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes will do

this.offset = offset;
}

public InstitutionsGetRequest(Integer count, Integer offset, boolean includeInstitutionData) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a .withIncludeInstitutionData(boolean) instead of creating more constructors?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes will do

}


public InstitutionsSearchRequest withProducts(Product... products) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a .withIncludeInstitutionData(boolean) instead of creating more constructors?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes will do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh. I'm not a big fan of object mutation here. Can we either make it a static factory method (ie. static method that always returns a new object)?

return url;
}

public void setUrl(String url) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need these setters?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@notthefakestephen notthefakestephen force-pushed the st-add-include-institution-data branch from eb9038e to 609a4b8 Compare March 4, 2019 23:43

@Test
public void testSuccessWithIncludeInstitutionDataTrue() throws Exception {
Response<InstitutionsGetByIdResponse> response = client().service().institutionsGetById(new InstitutionsGetByIdRequest(TARTAN_BANK_INSTITUTION_ID).withIncludeInstitutionData(true))
Copy link
Copy Markdown

@mattiskan mattiskan Mar 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we try to keep these within the width of what github displays?

List<AssetReportGetResponse.Account> accounts = assetReport.getItems().get(0).getAccounts();
for (AssetReportGetResponse.Account account : accounts) {
if (account.getTransactions().size() > 0) {
return account.getTransactions().get(0).getName() != null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm that a "" transaction name should return true.

Also, I can't see this method being used anywhere, what is it meant for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah it was to prevent some flakiness but yes "" should return true, a report without insights will not have the name key


assertSuccessResponse(response);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two tests look to me like a missed opportunity to reflect what difference setting true vs false means for the result object.
Update if you have time.

@notthefakestephen notthefakestephen merged commit d04f5d8 into master Mar 7, 2019
@notthefakestephen notthefakestephen deleted the st-add-include-institution-data branch March 7, 2019 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants